package com.jason.data.agentbase;

import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
import org.springframework.context.annotation.Bean;

/**
 * 自定义切面
 */
//@Configuration
public class InterceptorConfig {


    @Bean
    public DefaultPointcutAdvisor DefaultPointcutAdvisor() {

        DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor();

        MyMethodInterceptor interceptor = new MyMethodInterceptor();


        AnnotationMatchingPointcut pointcut = new AnnotationMatchingPointcut(MDS.class,true);

        advisor.setAdvice(interceptor);
        advisor.setPointcut(pointcut);

        return advisor;
    }
}
